/*
 *  Copyright (C) 2011 Jesus Navalon i Pastor <jnavalon at redhermes dot net>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * pn_ToolBar.java
 *
 * Created on 01/06/2011, 18:44:41
 */
package kuasar.plugin.servermanager.gui;

/**
 *
 * @author Jesus Navalon i Pastor <jnavalon at redhermes dot net>
 */

public class pn_ToolBar extends javax.swing.JPanel {

    /** Creates new form pn_ToolBar */
    private pn_Main main;
    public pn_ToolBar(pn_Main panel) {
        main = panel;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tb_Actions = new javax.swing.JToolBar();
        lbl_toRoot = new javax.swing.JLabel();
        lbl_wizard = new javax.swing.JLabel();
        lbl_addGroup = new javax.swing.JLabel();
        lbl_addServer = new javax.swing.JLabel();
        lbl_Remove = new javax.swing.JLabel();
        lbl_Config = new javax.swing.JLabel();

        setOpaque(false);

        tb_Actions.setBorder(null);
        tb_Actions.setFloatable(false);
        tb_Actions.setBorderPainted(false);
        tb_Actions.setOpaque(false);

        lbl_toRoot.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/toRoot.png"))); // NOI18N
        lbl_toRoot.setToolTipText("Go to root");
        lbl_toRoot.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_toRoot.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_toRootMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_toRoot);

        lbl_wizard.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/wizard.png"))); // NOI18N
        lbl_wizard.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_wizard.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_wizardMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_wizard);

        lbl_addGroup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/folder-new.png"))); // NOI18N
        lbl_addGroup.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_addGroup.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_addGroupMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_addGroup);

        lbl_addServer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/add-server.png"))); // NOI18N
        lbl_addServer.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_addServer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_addServerMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_addServer);

        lbl_Remove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/remove.png"))); // NOI18N
        lbl_Remove.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_Remove.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_RemoveMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_Remove);

        lbl_Config.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuasar/plugin/servermanager/icons/configure.png"))); // NOI18N
        lbl_Config.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lbl_Config.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbl_ConfigMouseClicked(evt);
            }
        });
        tb_Actions.add(lbl_Config);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tb_Actions, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tb_Actions, javax.swing.GroupLayout.DEFAULT_SIZE, 56, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void lbl_ConfigMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_ConfigMouseClicked
        main.loadConfig();
    }//GEN-LAST:event_lbl_ConfigMouseClicked

    private void lbl_addGroupMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_addGroupMouseClicked
       main.loadAddGroup();
    }//GEN-LAST:event_lbl_addGroupMouseClicked

    private void lbl_addServerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_addServerMouseClicked
        main.loadAddServer();
    }//GEN-LAST:event_lbl_addServerMouseClicked

    private void lbl_RemoveMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_RemoveMouseClicked
        main.delSelectedNode();
    }//GEN-LAST:event_lbl_RemoveMouseClicked

    private void lbl_toRootMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_toRootMouseClicked
        main.goToRoot();
    }//GEN-LAST:event_lbl_toRootMouseClicked

    private void lbl_wizardMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbl_wizardMouseClicked
        main.loadWizard();
    }//GEN-LAST:event_lbl_wizardMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lbl_Config;
    private javax.swing.JLabel lbl_Remove;
    private javax.swing.JLabel lbl_addGroup;
    private javax.swing.JLabel lbl_addServer;
    private javax.swing.JLabel lbl_toRoot;
    private javax.swing.JLabel lbl_wizard;
    private javax.swing.JToolBar tb_Actions;
    // End of variables declaration//GEN-END:variables
}
